import http from '@/api';
import { ADMIN_PREFIX_V2 } from '@/api/helper/prefix';
import type { IPage } from '@/api/interface';
import type { ISysTempFile } from '@/api/interface/system/sysTempFile';

/**
 * 查询列表
 * @param params
 * @returns {*}
 */
export const getSysTempFileListApi = (params: ISysTempFile.Query) => {
  return http.get<IPage<ISysTempFile.Row>>(ADMIN_PREFIX_V2 + `/sys-temp-file/list`, params);
};

/**
 * 添加
 * @param params
 * @returns {*}
 */
export const createSysTempFileApi = (params: ISysTempFile.Form) => {
  return http.post(ADMIN_PREFIX_V2 + `/sys-temp-file/create`, params);
};

/**
 * 修改
 * @param params
 * @returns {*}
 */
export const updateSysTempFileApi = (params: ISysTempFile.Form) => {
  return http.post(ADMIN_PREFIX_V2 + `/sys-temp-file/update`, params);
};

/**
 * 删除
 * @param params
 * @returns {*}
 */
export const removeSysTempFileApi = (params: { ids: (string | number)[] }) => {
  return http.post(ADMIN_PREFIX_V2 + `/sys-temp-file/delete`, params);
};

/**
 * 获取详情
 * @param params
 * @returns {*}
 */
export const getSysTempFileDetailApi = (params: { id: number }) => {
  return http.get<ISysTempFile.Row>(ADMIN_PREFIX_V2 + `/sys-temp-file/info`, params);
};

/**
 * 模板文件下拉框
 */
export const getTempFileDropdown = () => {
  return http.get(ADMIN_PREFIX_V2 + `/sys-temp-file/dropdown`);
};
